package com.linsen.core.common.annotation;

import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.AliasFor;

import java.lang.annotation.*;

/**
 * 组合注解
 * @author zhaoyong
 * @date 2023/3/13
 */
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Configuration(
        proxyBeanMethods = false
)
@AutoConfigureBefore
@AutoConfigureAfter
public @interface AutoConfiguration {
    @AliasFor(
            annotation = Configuration.class
    )
    String value() default "";

    @AliasFor(
            annotation = AutoConfigureBefore.class,
            attribute = "value"
    )
    Class<?>[] before() default {};

    @AliasFor(
            annotation = AutoConfigureBefore.class,
            attribute = "name"
    )
    String[] beforeName() default {};

    @AliasFor(
            annotation = AutoConfigureAfter.class,
            attribute = "value"
    )
    Class<?>[] after() default {};

    @AliasFor(
            annotation = AutoConfigureAfter.class,
            attribute = "name"
    )
    String[] afterName() default {};
}

